package com.kantboot.api.email.web.controller;

import com.kantboot.api.email.domain.dto.EmailSendDTO;
import com.kantboot.api.email.domain.entity.ApiEmail;
import com.kantboot.api.email.service.IApiEmailService;
import com.kantboot.util.common.result.RestResult;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api-email-web/email")
public class ApiEmailController {

    @Resource
    private IApiEmailService service;

    /**
     * 发送
     * @return 发送结果
     */
    @RequestMapping("/send")
    public RestResult<ApiEmail> send(@RequestBody EmailSendDTO dto){
        ApiEmail send = service.send(dto);
        return RestResult.success(send,"sendSuccess","发送成功");
    }

}
